#include<bits/stdc++.h>
#define int long long
#define eps 1e-8
#define il inline
#define ct const
#define dl double
#define pk push_back
#define fi first
#define se second
#define pii pair<int,int>
#define N 1000010
#define down 0.999
using namespace std;
il int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+(ch^48);ch=getchar();
	}
	return x*f;
}
char f__[40];
il void write(int x){
	int cnt=0;
	if(x<0){
		putchar('-');x=-x;
	}
	if(!x) putchar('0');
	while(x){
		f__[cnt++]=x%10+'0';x/=10;
	}
	while(cnt) putchar(f__[--cnt]);
}
int n;
dl ans=1000000.0;
struct aa{
	dl a,b;
} c[N];
struct node{
	dl x,y,z;
};
il dl dis(node u){
	return sqrtl(u.x*u.x+u.y*u.y+u.z*u.z);
}
il dl solve(dl x){
	dl res=0;
	for(int i=1;i<=n;++i){
		dl x_=x+(i-1),tmp=c[i].a*c[i].a/4+c[i].b*c[i].b;
		res=max(res,sqrt((x_+0.5)*(x_+0.5)+tmp));
		res=max(res,sqrt((x_-0.5)*(x_-0.5)+tmp));
	}
	return res;
}
mt19937 rnd(time(0));
signed main(){
	srand(time(0));
	freopen("temple.in","r",stdin);
	freopen("temple.out","w",stdout);
	n=read();
	for(int i=1;i<=n;++i) scanf("%lf%lf",&c[i].a,&c[i].b);
	dl t=10000;
	while(t>eps){
		int op=rnd()%2;dl res=1000000.0;
		if(op){
			int u=rnd()%n+1;
			swap(c[u].a,c[u].b);
			dl l=-1000000.0,r=1.0;
			while(l+eps<r){
				dl mid1=l+(r-l)/3,mid2=r-(r-l)/3;
				dl res1=solve(mid1),res2=solve(mid2);
				if(res1<res2) r=mid2;
				else l=mid1;
			}
			res=solve(l);
			if(exp(t/(ans-res))*RAND_MAX<rand()) swap(c[u].a,c[u].b);
			ans=min(ans,res);
		}
		else{
			int u=rnd()%n+1,v=rnd()%n+1;
			swap(c[u],c[v]);
			dl l=-15.0,r=1.0;
			while(l+eps<r){
				dl mid1=l+(r-l)/3,mid2=r-(r-l)/3;
				dl res1=solve(mid1),res2=solve(mid2);
				if(res1<res2) r=mid2;
				else l=mid1;
			}
			res=solve(l);
			if(exp(t/(ans-res))*RAND_MAX<rand()) swap(c[u],c[v]);
			ans=min(ans,res);
		}
		t*=down;
	}
	printf("%.10lf",ans);
	cerr<<"\n"<<(dl)clock()/CLOCKS_PER_SEC;
	return 0;
}